function person(name,age){
    this.name=name;
    this.age=age;
    this.greet=function(){
        return "hello my name is"+this.name+"and i am "+this.age+"year old"
    }
}
var person1=new person("张三",30) 
console.log(person1.greet());